//
//  BIProjectContext.h
//  BIUserModule
//
//  Created by 杨洋 on 2021/8/19.
//

#import "BIAppDelegate.h"
#import "BITabBarVC.h"
#import "BIAppDefine.h"

#import <BIToolModule/BIProjectDefine.h>
#import <BIUserModule/BIUserModel.h>

@interface BIProjectContext : NSObject

/// 项目delegate
@property (nonatomic, readonly) BIAppDelegate *appDelegate;
/// 项目的tabbarVC
@property (nonatomic, readonly) BITabBarVC *tabBarVC;
/// 用户数据
@property (nonatomic, readonly) BIUserModel *user;

/// 单例声明
BISingletonInterface()

/// App启动时调用(AppDelegate调用)
- (void)launchWithOptions:(NSDictionary *)launchOptions;
/// App从后端进入前端时调用(AppDelegate调用)
- (void)resume;
/// App结束执行(AppDelegate调用)
- (void)terminate;
/// 远程推送注册成功(AppDelegate调用)
- (void)remoteNotificationsSucceed:(NSData *)deviceToken;
/// 接收远程通知，兼容iOS 10以下版本(AppDelegate调用)
- (void)didReceiveRemoteNotification:(NSDictionary *)userInfo;
/// 屏幕发生变化时调用(AppDelegate调用)
- (UIInterfaceOrientationMask)supportInterfaceOrientation;

/// 强制屏幕转向(比如某界面要横屏，调用该方法即可，退出界面时记得调用该方法恢复屏幕竖屏)
- (void)forceDeviceOrientation:(UIDeviceOrientation)deviceOrientation;
/// 打开登录页面
- (void)openLoginVCWithSucceedBlock:(dispatch_block_t)succeedBlock;
/// 更新全局的用户信息
- (void)updateUserInfo:(BIUserModel *)userInfo;
/// 用户退出
- (void)logout;

@end
